using System.Net.Http;
using System.Threading.Tasks;
using Abp.Json;
using AVISOutBound.PCSite.ApiClient;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;

namespace AVISOutBound.PCSite.Web.Controllers
{
    public class HomeController : PCSiteControllerBase
    {
        private readonly AvisApiClient _apiClient;

        public HomeController(AvisApiClient apiClient)
        {
            _apiClient = apiClient;
        }
        public async Task<ActionResult> Index()
        {
            return View();
        }

        public async Task<IActionResult> GetIndexBanner()
        {
            ViewBag.Json = await _apiClient.GetIndexBanner();
            return View("Index");
        }

        public async Task<IActionResult> LoginRequiredFunction()
        {
            ViewBag.Json = await _apiClient.GetLoginRequiredFunction();
            return View("Index");
        }

        public async Task<IActionResult> Test()
        {
            return Json(Request.Query);
        }

        [Authorize]
        public ActionResult About()
        {
            return View();
        }
    }
}